package yxy.game.pm2.module.union.rank;

import org.joda.time.DateTime;
import yxy.game.pm2.bean.ServerBean;
import yxy.game.pm2.bean.area.AreaBean;
import yxy.game.pm2.bean.area.AreaGroupBean;
import yxy.game.pm2.bean.module.rank.PlayerRankModule;

//按战区内排行：联盟等级排行
public class RankAreaGroupLevelUnion extends UnionAreaGroupRankModule {

	public RankAreaGroupLevelUnion(AreaGroupBean areaGroupBean) {
		super(areaGroupBean);
	}

	@Override
	public String rankName() {
		return PlayerRankModule.getAllRankNames().get(7);
	}

	@Override
	protected boolean reconsitution() {
		return false;
	}

	@Override
	protected long valuePlastic(long value) {
		return value * 10000000000000L + (10000000000000L - DateTime.now().getMillis());// 13位时间戳长度
	}

	@Override
	protected long valueRestore(long score) {
		return score / 10000000000000L;
	}

	static public RankAreaGroupLevelUnion get(int areaGroupId) {
		AreaGroupBean areaGroupBean = AreaGroupBean.get(areaGroupId);
		if (areaGroupBean == null) {
			return null;
		}
		return new RankAreaGroupLevelUnion(areaGroupBean);
	}
}
